<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="format-detection" content="telephone=no" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<script type="text/javascript" src="/static/admin/js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="/static/admin/js/rem.js"></script>
	<link rel="stylesheet" href="/static/admin/css/index.css" />
	<link rel="stylesheet" href="/static/admin/css/icon/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="/static/admin/css/cars.css"/>
	<title>查询停车费</title>
</head>
<style>
	.carui-order-detail-top-box{
		margin-top:14px;
	}
	.carui-order-detail-top-deal-status{
		margin-top:14px;
		margin-bottom:20px;
	}
</style>
<body>
		<div class="car_content">
	        <div class="car_mpecot">
				<ul class="mui-table-view mui-table-view-chevron">
					<li class="car-mui-table-view-cell-aft carui-stop-detail-li-clear-padding">
						
						<div class="carui-order-detail-top-money">{$orderinfo.amountDue/100}&nbsp;元</div>
						
						<div class="carui-order-detail-top-deal-status">停车信息</div>
						<div class="car_mpecotTBottom">
							
							<div class="carui-order-detail-text-box">
								<span class="car_mpecotTL">停车位置</span>
								<span class="car_mpecotTR">{$parkinginfo.parkingName}</span>
							</div>
						
						
							<div class="carui-order-detail-text-box">
								<span class="car_mpecotTL">车牌号</span>
								<span class="car_mpecotTR">{$orderinfo.carPlateNo}</span>
							</div>
							
							<div class="carui-order-detail-text-box">
								<span class="car_mpecotTL">入场时间</span>
								<span class="car_mpecotTR">{$orderinfo.parkingStartTime|strtotime|date="Y-m-d H:i:s"}</span>
							</div>
						
							<div class="carui-order-detail-text-box">
								<span class="car_mpecotTL">停车时长</span>
								<span class="car_mpecotTR">{$orderinfo.parkingTime|ctime}</span>
							</div>
							<div class="carui-order-detail-text-box">
								<span class="car_mpecotTL">应收金额</span>
								<span class="car_mpecotTR">{$orderinfo.amountDue/100}&nbsp;元</span>
							</div>
							<div class="carui-order-detail-text-box">
								<span class="car_mpecotTL">实收金额</span>
								<span class="car_mpecotTR">{$orderinfo.amountRec/100}&nbsp;元</span>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	<div class="footer">
		<p style="text-align:center"><i class="iconfont layui-extend-gantanhao"></i>请于付款后15分钟内离场，超时将加收停车费</p>
		<span onclick="createOrder('{$pay_id}')"><button style="background-color:#0066ff">立即付款</button></span>
	</div>
	
	
	
<script type="application/javascript">
	function createOrder(pay_id){
		var url = '{:url("createOrder")}'
		$.post(url, {pay_id: pay_id}, function(r){
			
			if (r.order_no) {
				tradePay(r.order_no)
			}else{
				alert(r.info)
                location.reload()
                // window.location.href="{:url('admin/Order/orderindex')}";
			}
		})
	}

	// 由于js的载入是异步的，所以可以通过该方法，当AlipayJSBridgeReady事件发生后，再执行callback方法
	function ready(callback) {
		 if (window.AlipayJSBridge) {
			 callback && callback();
		 } else {
			 document.addEventListener('AlipayJSBridgeReady', callback, false);
		 }
	}

	function tradePay(tradeNO) {
		ready(function(){
			 // 通过传入交易号唤起快捷调用方式(注意tradeNO大小写严格)
			 AlipayJSBridge.call("tradePay", {
				  tradeNO: tradeNO
			 }, function (data) {
				 if ("9000" == data.resultCode) {
					  
					var url="https://ur.alipay.com/6Jcq9Z";
					window.location.href=url;
				 }
			 });
		});
	}
</script>
</body>

</html>